home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000062_icon-group-sender _Mon Mar 4 20:58:38 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 4 Mar 1996 16:21:13 MST
  2. From: "Hamish Lawson" <H.Lawson@tees.ac.uk>
  3. Organization:  University of Teesside (SCM)
  4. To: icon-group@cs.arizona.edu
  5. Date:          Mon, 4 Mar 1996 20:58:38 GMT0BST
  6. Subject:       Production of an operator's left-hand operand
  7. Reply-To: H.Lawson@tees.ac.uk
  8. Priority: normal
  9. X-Mailer: Pegasus Mail for Windows (v2.0-WB2)
  10. Message-Id: <B461B2458B@scm_arkengarthdale.tees.ac.uk>
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: O
  13.  
  14. I understand the logic behind having operators produce their 
  15. right-hand operand, in order that we can do stuff like
  16.  
  17.    if x < y < z then
  18.  
  19. However I frequently want to have the right-hand operand produced, 
  20. e.g to print x only if it is greater than 5 I cannot say 
  21.  
  22.    write(x > 5)
  23.  
  24. but must instead say
  25.  
  26.    write(5 < x)
  27.  
  28. Aside from the slight artificiality in such a construct this
  29. rearrangement may not work (and correct me if I'm wrong) if I want to
  30. do something like printing the value of e1 only if e2 succeeds; that
  31. is, I cannot necessarily rewrite this as
  32.  
  33.    write(e2 & e1)
  34.  
  35. Want would be nice would be parallel operators that produce their
  36. left-hand operand; a possible notation would be to prefix the
  37. standard operator with a ^ (there may be better schemes, perhaps a
  38. suffix ~):
  39.  
  40.    write(e1 ^& e2)  # produces e1 only if e2 succeeds
  41.  
  42. Aside from the usual problems of getting a new feature adopted in a
  43. language, are their any other problems with such an idea?
  44.  
  45. | Hamish Lawson, School of Computing and Mathematics, 
  46. | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA 
  47. | Tel: +44 1642 218121 x3611  Fax: +44 1642 342604
  48. | E-mail: H.Lawson@tees.ac.uk 
  49.